#include "../../ThreadPool.h"
#include "../../Runnable.h"

#include <stdio.h>

#include <time.h>

#include <unistd.h>

class WorkTask : public Runnable
{
	
public:
	WorkTask();
	~WorkTask();
	
	virtual void run()
	{
		time_t timep;
		time( &timep);
		printf("work task %s\n", asctime(gmtime(&timep)) );
	
		sleep(10);
	
		printf("finish\n");
	}
};

#include <unistd.h>

int main()  
{  
	WorkTask task; 
  
	ThreadPool threadpool(10);  
	for(int i = 0;i < 11;i++)  
	{  
		threadpool.AddTask(&task);  
	}  
	while(1)  
	{  
		sleep(120);  
	}  
	return 0;  
	
}